/***************************************************************
****************************************************************
*************** Parser For Compilated LPMED ********************
****************************************************************
***************************************************************/

parser grammar cLPMED;

options
{
	tokenVocab = LPMEDLexer;
	output = AST;
	ASTLabelType=CommonTree;
	language = CSharp2;
}

import LPMEDParser;

@namespace { Core.ANTLRGrammars }

@members
{
	public System.Collections.Generic.List<Exception> Logger = new System.Collections.Generic.List<Exception>();
}

//#################################### Constructions declarations ###################################################


//######################################## Main Rule ################################################################
program 
scope
{
 string DDname;
}
: DEVICE name=ID {$program::DDname=$name.text;} block ENDDEVICE -> ^(CPROGRAM ^(CDEVICE $name) block);
catch [Exception e] {Logger.Add(e); if (e is RecognitionException) Recover(input,(RecognitionException)e);}